from aip import AipSpeech

""" 你的 APPID AK SK """
APP_ID = '16436279'
API_KEY = 'Y4A4TuCxAzrx6haB8PMuQRCP'
SECRET_KEY = 'TYGXDfVQvC4degzeZvZnYhAfx5ubq1y7'

client = AipSpeech(APP_ID, API_KEY, SECRET_KEY)

result  = client.synthesis('先帝创业未半而中道崩殂，唧唧复唧唧', 'zh', 1, {
	"spd": 4,
    'vol': 10,
	"pit": 8,
	"per": 4
})
print(result)
# 识别正确返回语音二进制 错误则返回dict 参照下面错误码
if not isinstance(result, dict):
    with open('auido.mp3', 'wb') as f:
        f.write(result)